<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 宝贝嘉燕
  Date: 2021/9/27
  Time: 9:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<c:if  test="${empty list}">
  尚无数据，请访问Servlet
</c:if>
<c:if test="${not empty list}">
  <table border="1px">
    <tr>
      <th>商品序号</th>
      <th>商品名称</th>
      <th>商品图片</th>
      <th>商品价格</th>
      <th>商品描述</th>
    </tr>
    <c:forEach var="pro" items="${list}" varStatus="st">
      <tr>
        <td>${st.index}</td>
        <td>${pro.name}</td>
        <td><img src="${pageContext.request.contextPath}/${pro.imgPath}"></td>
        <td>${pro.price}</td>
        <td>${pro.info}</td>
      </tr>
    </c:forEach>
  </table>
</c:if>
</body>
</html>
